package edu.zime.iot.dao;


import edu.zime.iot.entity.Course;
import edu.zime.iot.entity.Score;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class ScoreDao {
//    @Autowired
//    private JdbcTemplate jdbcTemplate;
//
//    public List<Score> getAll()
//    {
//        return jdbcTemplate.query("select * from score",new BeanPropertyRowMapper<>(Score.class));
//    }
//    public int addScore(Score score)
//    {
//        return jdbcTemplate.update("INSERT INTO score(lesson,teacher) VALUES(?,?)",score.getLesson(),score.getTeacher());
//    }
//    public int updateCourse(Course course)
//    {
//        return jdbcTemplate.update("UPDATE course SET lesson=?,teacher=? WHERE id=?",course.getLesson(),course.getTeacher(),course.getId());
//    }
//    public int deleteCourseById(int id)
//    {
//        return jdbcTemplate.update("DELETE FROM Course WHERE id=?",id);
//    }
//    public Course getCourseById(int id)
//    {
//        return jdbcTemplate.queryForObject("select * from where id=?", new BeanPropertyRowMapper<>(Course.class),id);
//    }
}
